notebook / code samples: Auto-updating sidebar script#1148
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
nrichers
left a comment
There was a problem hiding this comment.
This looks like a nice fix for an existing issue but I do have one aesthetic comment: we use sentence-style caps in your navigation and your code applies title-style caps. It might be good to update the script to match our convention.
(Approving this as we agreed that aesthetic/style differences should not prevent a PR from being approved.)
Arguably, things outlined in our style guide lean towards the technical accuracy bucket, and it would bother me if I saw something and it didn't align, so I think this is fair. Updated in 9513a1a.
|
PR SummaryThis PR introduces an enhancement to the project’s sidebar configuration. The changes can be summarized as follows:
Overall, these changes provide a more robust and maintainable approach to managing the sidebar entries related to code samples, ensuring that any additions or modifications in the code samples directories are accurately reflected in the sidebar configuration. Test Suggestions
|
Lighthouse check resultsShow Lighthouse scoresFolder depth level checked: 0 Commit SHA: b9e47cb Modify the workflow to check a different depth:
|
Validate docs site✓ INFO: A live preview of the docs site is available — Open the preview |

Pull Request Description
What and why?
The code samples sidebar in the "ValidMind Library" portal had improper capitalisation of the NLP & LLM directory:
code_samplessubdirectory in the sidebar. Accomplished by addingsite/scripts/update_code_samples_sidebar.pywhich reads subdirectories ofnotebooks/code_samples/, sorts them alphabetically, and rewrites the “Code samples” links indeveloper/_sidebar.yamlincluding adding the proper capitalisation for NLP & LLM.section:(nottext:) so Quarto renders them as expandable accordion sections.site/Makefile:make notebooksnow runs the new Python script above after copying notebooks and before zipping, so the sidebar stays in sync with the currentcode_samplesdirectories whenever make notebooks is run.documentation/site/Makefile
Line 330 in e8ed26a
How to test
gh pr checkout 1148cd site_source/validmind-library/notebooks/code_samples/test_directorytest.ipynbmkdir -p _source/validmind-library/notebooks/code_samples/test_directory python3 -c 'import json; n={"nbformat":4,"nbformat_minor":4,"metadata":{},"cells":[{"cell_type":"markdown","metadata":{},"source":["test"]}]}; open("_source/validmind-library/notebooks/code_samples/test_directory/test.ipynb","w").write(json.dumps(n, indent=1))'make notebookssite/developer/_sidebar.yamland confirm:What needs special review?
n/a
Dependencies, breaking changes, and deployment notes
n/a
Release notes
n/a
Checklist